
import UIKit

/// 事件
public protocol Event {
    associatedtype ParamType
    /// 发送事件
    func send(_ params: ParamType)
    /// 添加事件处理
    func addHandle(_ handle: (ParamType) -> Void)
}
//class xx: UIViewController {
//    let appear: ObserveTiming
//    override func viewWillAppear(_ animated: Bool) {
//        
//    }
//    override func viewWillDisappear(_ animated: Bool) {
//        super.viewWillDisappear(animated)
//        /// kvo
//        when(self).appear.observe(UIView()).tag.before {
//            
//        }
//        when(self).appear.unobserve(UIView()).tag.before()
//        when(self).appear.unobserve(UIView()).tag()
//        /// 黑魔法
//        when(self).appear.observe(UIView()).method(#selector()).before {
//            
//        }
//        when(self).appear.unobserve(UIView()).method(#selector()).before()
//        /// NotificationCenter
//        when(self).appear.observe(.didBecomeActiveNotification) {
//            
//        }
//        when(self).appear.unobserve(.didBecomeActiveNotification)
//        when(self).appear.observe("name of notification") {
//            
//        }
//        when(self).appear.unobserve("name of notification")
//        /// Delegate
//        when(self).appear.observe(UIView()).delegate.method(#selector()).before { observer, params in
//
//        }
//        when(self).appear.unobserve(UIView()).delegate.method(#selector()).before()
//        /// Event
//        when(Self).alive.observe(obj).statusChanged {
//            
//        }
//        when(Self).alive.unobserve(obj.statusChanged)
//        
//        when(Self).now.observe(obj.statusChanged) {
//            
//        }
//        when(Self).now.unobserve(obj.statusChanged)
//
//        when(Self.alive).unobserve(obj.statusChanged) {
//
//        }
//        when(.now).observe(obj.statusChanged) {
//
//        }
//        when(.now).unobserve(obj.statusChanged)
//    }
//}
